<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>绝对全局对象-globalThis</title>
</head>
<body>
<script>
    // 永远指向 Window 对象

    var name = '张三'
    var age = 15

    function print() {
        let name='李四'
        console.log(globalThis.age)
        console.log(globalThis.name)//globalThis --this 永远指向 Window 对象
        console.log(this.name)// 调用函数this指向全局(window)
        console.log(name)
    }
    print()
</script>
</body>
</html>